<?php
header("Content-Type: text/html; charset=utf-8");
$username="eu_wilhelm";
$password="n3DN67xcDwPyba4S";
$database="eu_wilhelm";

$sessionID = $_GET['sessionID'];

mysql_connect("gis-db.uni-muenster.de",$username,$password) or die("Connection failed: ". mysql_error());

@mysql_select_db($database) or die( "Unable to select database: ". mysql_error());

if($sessionID == ""){
	$query="SELECT * FROM poiLogger";
}
else{
	$query="SELECT * FROM poiLogger WHERE sessionID = $sessionID";
}

$result=mysql_query($query);

print("point" . "\t" . "title" . "\t" . "description" . "\t" . "icon \n");



while($row = mysql_fetch_row($result))
	{
	//id, sessionID, categorie, name, chapter, lat, lon, date
	$x = $row[6];
	$y = $row[5];
	$title = $row[3];
	$descrip = "Kapitel: ".$row[4]. " Kategorie: ".$row[2]." Datum: ".$row[7]. " sessionID: ".$row[1];
	print("$y,$x" . "\t" . "Name: $title" . "\t" . "$descrip" . "\t" . "http://www.sanpedro.com/sp_point/marker_green.png" . "\n");
	}
mysql_free_result($result);

?>